@extends('layouts.master')

@section("css")
		@parent
@stop

@section("body")
<div class="row">
	<div class="col-md-12">
		<!-- BASIC TABLE -->
		<div class="panel">
			<div class="panel-heading">
				<h3 class="panel-title">用户列表</h3>
			</div>
			<div class="panel-body">
				<table class="table table-hover">
					<thead>
						<tr>
							<th>编号</th>
							<th>姓名</th>
							<th>登录账号</th>
							<th>角色</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						 @foreach($users as $user)
							 <tr>
									<td>
										<input class="form-control" id="id" type="text"  readonly name="" value="{{$user['id']}}">
									</td>
									<td>
											<input class="form-control" id="name" type="text" name="" value="{{$user['name']}}">
									</td>
									<td>
										<input class="form-control" id="uname" type="text" name="" value="{{$user['uname']}}">
									</td>
									<td>
										<select class="form-control" id="role_id">
												 @foreach($roles as $role)
															<option value="{{$role['id']}}"
																	@if($role['id'] == $user['role_id'])
																			selected
																	@endif
															>{{$role['role_name']}}</option>
												 @endforeach
										</select>
									</td>
									<td>
											<div class="btn-group">
												 <div class="get_btn btn btn-default">修改</div>
												 <div id='delete_btn' class="delete_btn btn btn-default">删除</div>
											</div>
									</td>
							 </tr>
							 @endforeach
					</tbody>
				</table>
			</div>
		</div>
		<!-- END BASIC TABLE -->
	</div>
</div>

@stop

@section("js")
		@parent
		<script type="text/javascript" src="/js/pages/admin/user/list.js"></script>
@stop